#include "glovesdata.h"
#include "buffs.h"
#include "symbol.h"
#include "creature.h"
#include "message.h"

bool Gloves::ItemSymbol( IO::Sym* symbol ) const
{
    symbol->first = '[';
    return true;
}

bool Gloves::ItemType( uint* type ) const
{
    *type |= WEARABLE_HAND | WIELDABLE_1H;
    return true;
}

bool Gloves::ItemCategory( uint* category ) const
{
    *category = ARMOUR;
    return true;
}

bool LeatherGloves::Name( std::string* name, bool* plural, uint article ) const
{
    if ( name->empty() && article == ARTICLE_INDEFINITE )
        *name += "a ";
    if ( article == ARTICLE_PLURAL )
        *name += "pairs of leather gloves";
    else if ( article == ARTICLE_INDEFINITE )
        *name += "pair of leather gloves";
    else {
        *name += "leather gloves";
        *plural = true;
    }
    return true;
}

bool LeatherGloves::ItemSymbol( IO::Sym* symbol ) const
{
    Gloves::ItemSymbol( symbol );
    symbol->second = Colour( 192, 128, 64 );
    return true;
}

bool LeatherGloves::CreateWearBuff( CompoundBuff** buff ) const
{
    ( *buff )->AddBuff( new StatsBuff( 0, 0, 0, 0, 0, 1, 0, 0 ) );
    return true;
}

bool LeatherGloves::Flammable( uint* flammableType ) const
{
    *flammableType |= FLAMMABLE_BURN_LONG | FLAMMABLE_SMOULDER_SHORT | FLAMMABLE_CHAR;
    return true;
}

bool LeatherGloves::ItemWeight( uint* weight ) const
{
    *weight += 15;
    return true;
}

bool LeatherGloves::OnEaten( Creature* c )
{
    uint fire;
    Call< BIFire >( &fire );
    if ( fire & BIFire::FIRE_CHARRED )
        Bank().Manipulation( MANIPULATION_EAT_CHARRED_LEATHER, c, this );
    else
        Bank().Manipulation( MANIPULATION_EAT_LEATHER, c, this );
    Destroy();
    return true;
}
